{% extends 'goods_base.html' %}

{%block goods_body%}
	<div class="navbar_con">
		<div class="navbar clearfix">
			<div class="subnav_con fl">
				<h1>全部商品分类</h1>	
				<span></span>			
				<ul class="subnav">
					<li><a href="/goods/list{{type0}}_1_1" class="fruit">新鲜水果</a></li>
					<li><a href="/goods/list{{type1}}_1_1" class="seafood">海鲜水产</a></li>
					<li><a href="/goods/list{{type2}}_1_1" class="meet">猪牛羊肉</a></li>
					<li><a href="/goods/list{{type3}}_1_1" class="egg">禽类蛋品</a></li>
					<li><a href="/goods/list{{type4}}_1_1" class="vegetables">新鲜蔬菜</a></li>
					<li><a href="/goods/list{{type5}}_1_1" class="ice">速冻食品</a></li>
				</ul>
			</div>
			<ul class="navlist fl">
				<li><a href="/goods/">首页</a></li>
				<li class="interval">|</li>
				<li><a href="#">手机生鲜</a></li>
				<li class="interval">|</li>
				<li><a href="#">抽奖</a></li>
			</ul>
		</div>
	</div>

	<div class="breadcrumb">
		<a href="/goods/">全部分类</a>
		<span>></span>
		<a href="/goods/list0_1_1/">{{title}}</a>
	</div>

	<div class="main_wrap clearfix">
		<div class="l_wrap fl clearfix">
			<div class="new_goods">
				<h3>新品推荐</h3>
				<ul>
					{% for goods in news %}
						<li>
							<a href="/goods/{{goods.id}}/"><img src="/static/{{goods.goods_pic}}"></a>
							<h4><a href="/goods/{{goods.id}}/">{{goods.goods_title}}</a></h4>
							<div class="prize">￥{{goods.goods_price}}</div>
						</li>
					{% endfor%}
				</ul>
			</div>
		</div>

		<div class="r_wrap fr clearfix">
			<div class="sort_bar">
				<a href="/goods/list{{typeinfo.id}}_1_1/"
				{% if sort_rules == '1' %}
						class="active"
					{% endif %}>默认</a>
				<a href="/goods/list{{typeinfo.id}}_1_2/"
				{% if sort_rules == '2' %}
						class="active"
					{% endif %}>价格</a>
				<a href="/goods/list{{typeinfo.id}}_1_3/"
				{% if sort_rules == '3' %}
						class="active"
					{% endif %}>人气</a>
			</div>

			<ul class="goods_type_list clearfix">
				{% for goods in page_list %}
					<li>
						<a href="/goods/{{goods.id}}/"><img src="/static/{{goods.goods_pic}}"></a>
						<h4><a href="{{goods.id}}/">{{goods.goods_title}}</a></h4>
						<div class="operate">
							<span class="prize">￥{{goods.goods_price}}</span>
							<span class="unit">{{goods.goods_price}}/{{goods.goods_price_unit}}克</span>
							<a href="/cart/add{{goods.id}}_1/" class="add_goods" title="加入购物车"></a>
						</div>
					</li>
				{% endfor %}
			</ul>

			<div class="pagenation">
				{% if page_list.has_previous %}
					<a href="/goods/list{{typeinfo.id}}_{{page_list.previous_page_number}}_{{sort_rules}}/">上一页</a>
				{% endif %}

				{% for page_index in paginator.page_range %}
					{% if page_index == page_list.number%}
						<a href="#" class="active">{{page_index}}</a>
					{% else %}
						<a href="/goods/list{{typeinfo.id}}_{{page_index}}_{{sort_rules}}/">{{page_index}}</a>
					{% endif %}
				{% endfor %}

				{% if page_list.has_next %}
					<a href="/goods/list{{typeinfo.id}}_{{page_list.next_page_number}}_{{sort_rules}}/">下一页</a>
				{% endif %}
			</div>
		</div>
	</div>
{%endblock goods_body%}
